package cc.rengu.igas.bomp.common.enums;

/**
 * Created by zhangxuran on 2020/04/21
 */
public enum SettleTypeEnum {
    D0_TYPE("D0", "D+0清算"),
    D1_TYPE("D1", "D+1清算"),
    T1_TYPE("T1", "T+1清算"),
    TN_TYPE("TN", "T+N清算"),
    MT_TYPE("MT", "按月清算"),
    ST_TYPE("ST", "按季清算"),
    ;
    private String settleCode;
    private String settleDesc;

    SettleTypeEnum(String settleCode, String settleDesc) {
        this.settleCode = settleCode;
        this.settleDesc = settleDesc;
    }

    public String getSettleCode() {
        return settleCode;
    }

    public void setSettleCode(String settleCode) {
        this.settleCode = settleCode;
    }

    public String getSettleDesc() {
        return settleDesc;
    }

    public void setSettleDesc(String settleDesc) {
        this.settleDesc = settleDesc;
    }

    /*
     * 根据结算方式编码查询结算方式描述
     * settleCode 结算方式编码
     * return settDesc  结算方式
     * */
    public static String getDescBycode(String settleCode) {
        for (SettleTypeEnum settleTypeEnum : SettleTypeEnum.values()) {
            if (settleCode.equals(settleTypeEnum.getSettleCode())) {
                return settleTypeEnum.getSettleDesc();
            }
        }
        return null;
    }
}
